//
//  HZJNavigationController.swift
//  HZJNavigationView
//
//  Created by HZJ on 2017/2/20.
//  Copyright © 2017年 HZJ. All rights reserved.
//

import UIKit

class HZJNavigationController: UINavigationController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    override func pushViewController(_ viewController: UIViewController, animated: Bool) {
        self.interactivePopGestureRecognizer?.delegate = self as? UIGestureRecognizerDelegate
        super.pushViewController(viewController, animated: animated)
    }
    
    @objc func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
        
        guard self.childViewControllers.count == 1 else {
            return true
        }
        return false
    }

}
